package com.ll.agent.visitor;

import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.commons.AdviceAdapter;

import static org.objectweb.asm.Opcodes.ASM7;

/**
 * @description:
 * @author: LiuLei
 * @create: 2024-07-18
 **/
public class MyMethodVisitor extends AdviceAdapter {
    public MyMethodVisitor(MethodVisitor mv, int access, String name, String desc) {
        super(ASM7, mv, access, name, desc);
    }

    @Override
    protected void onMethodEnter() {
        // 在方法开始插入 return 50;
        mv.visitIntInsn(BIPUSH, 50);
        mv.visitInsn(IRETURN);
    }
}
